
import { getItem, setItem } from '@/utils/storage'
import { TOKEN } from '@/constant'
export default {
  state: () => ({
    token: getItem(TOKEN) || null,
  }),
  mutations: {
    setToken(state, token) {
      state.token = token
      setItem(TOKEN, token)
    }
  }
}